class Animal:
    def __init__(self, name, breed, aggressivity,life_valie):
        self.name = name
        self.breed = breed
        self.aggressivity = aggressivity
        self.life_value = life_valie
    def attack(self, animal):
        animal.life_value -= self.aggressivity
        if animal.life_value <= 0:
            print('{}攻击{}一次, {}被杀死！'.format(self.name, animal.name, animal.name))
            return  True
        else:
            print('{}攻击{}一次，{}的生命值还有{}'
                  .format(self.name, animal.name, animal.name, animal.life_value))
    def eat(self):
        pass
    def roleInfo(self):
        print('昵称: {}, 品种：{}, 攻击力： {}， 生命值{}'.format(self.name, self.breed, self.aggressivity, self.life_value))
class Cat(Animal):
    def eat(self):
        self.life_value += 50
        print('{}增加一次生命值，还有生命值{}'
            .format(self.name, self.life_value))
class Dog(Animal):
    def eat(self):
        self.life_value += 30
        print('{}增加一次生命值，还有生命值{}'
            .format(self.name, self.life_value))
print('-------角色信息--------')
cat =Cat('mily', '波斯猫', 30, 200)
cat.roleInfo()
dog =Dog('lucky', '哈士奇', 50, 300)
dog.roleInfo()
print('***********开始战斗************\n' '****** K或k键控制猫攻击，L或l键控制猫增加生命力 *****\n'
              '******* -键控制狗攻击，+键控制狗增加生命力 *********')
while True:
    order = input()
    if order == 'k' or order == 'k':
        if cat.attack(dog):
            break
    elif order == '-':
        if dog.attack(cat):
            break
    if order == 'L' or order == 'l':
        cat.eat()
    elif order == '+':
        dog.eat()
        # 曾文斌

